package com.ceres.entity;


/**
 * 返回结果实体类
 */
public class Result<T> {

    private boolean flag;//是否成功
    private Integer StatusCode;//返回码

    private T data;//返回数据

    public Result(boolean flag, Integer StatusCode,  Object data) {
        this.flag = flag;
        this.StatusCode = StatusCode;
        this.data = (T)data;
    }

    public Result(boolean flag, Integer StatusCode) {
        this.flag = flag;
        this.StatusCode = StatusCode;
    }

    public Result() {
        this.flag = true;
        this.StatusCode = com.ceres.entity.StatusCode.OK;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Integer getStatusCode() {
        return StatusCode;
    }

    public void setStatusCode(Integer StatusCode) {
        this.StatusCode = StatusCode;
    }


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
